package com.city.service.party.impl;

import com.city.domain.party.PartyFahu;
import com.city.repository.party.PartyFahuRepository;
import com.city.service.party.PartyFahuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @deprecation: 流动挂靠
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Service
public class PartyFahuServiceImpl implements PartyFahuService {

    @Autowired
    private PartyFahuRepository partyFahuRepository;

    @Override
    public List<PartyFahu> findByPage(Integer page, Integer limit) {
        return partyFahuRepository.findAllByPage((page-1)*limit,limit);
    }

    @Override
    public PartyFahu findById(int id) {
        return partyFahuRepository.findOne(id);
    }

    @Override
    public long count() {
        return partyFahuRepository.count();
    }

    @Override
    public void delete(int id) {
        partyFahuRepository.delete(id);
    }
}
